Import MaxMod.AudioStream
Import MaxMod.ModPlayer
Import MaxMod.OGG
Import MaxMod.MP3

'EnableOpenALAudio()
'SetAudioDriver("openal")
SetAudioDriver("directsound")

Local file$ = RequestFile( "", MusicExtensions() )
Graphics 320,40,0 ; Cls ; DrawText("loading please wait...",10,10) ; Flip
Local Channel:TChannel = CreateAudioStream( file )

Repeat
	Cls
	If KeyHit(KEY_R) ResumeChannel(Channel)
	If KeyHit(KEY_P) PauseChannel(Channel)
	If KeyHit(KEY_S) StopChannel(Channel)
	If ChannelPlaying(channel)
		DrawText("Streaming...",10,10)
	Else
		DrawText("Stopped...",10,10)
	EndIf
	Flip
Until AppTerminate() Or KeyHit(KEY_ESCAPE)

